package com.whfc.wxmp.api.fse.service.impl;

import com.whfc.common.result.ListData;
import com.whfc.common.result.PageData;
import com.whfc.fse.dto.FseBridgeDTO;
import com.whfc.fse.dto.FseBridgeDataDTO;
import com.whfc.fse.dto.FseBridgeDataLogDTO;
import com.whfc.fse.param.FseBridgeAddParam;
import com.whfc.fse.param.FseBridgeBindParam;
import com.whfc.fse.param.FseBridgeEditParam;
import com.whfc.fse.param.FseBridgeUnbindParam;
import com.whfc.fse.service.FseBridgeService;
import com.whfc.wxmp.api.fse.service.WxFseBridgeService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @Description 架桥机服务类
 * @Author hw
 * @Date 2021-06-01 18:01
 * @Version 1.0
 */
@Service
public class WxFseBridgeServiceImpl implements WxFseBridgeService {

    @DubboReference(interfaceClass = FseBridgeService.class, version = "1.0.0")
    private FseBridgeService fseBridgeService;

    @Override
    public PageData<FseBridgeDTO> list(Integer deptId, String keyword, Integer bindFlag, Integer netState, Integer pageNum, Integer pageSize) {
        return fseBridgeService.list(deptId, keyword, bindFlag, netState, pageNum, pageSize);
    }

    @Override
    public ListData<FseBridgeDTO> list(Integer deptId, String keyword, Integer bindFlag, Integer netState) {
        List<FseBridgeDTO> list = fseBridgeService.list(deptId, keyword, bindFlag, netState);
        return new ListData<>(list);
    }

    @Override
    public void add(FseBridgeAddParam param) {
        fseBridgeService.add(param);
    }

    @Override
    public void edit(FseBridgeEditParam param) {
        fseBridgeService.edit(param);
    }

    @Override
    public void del(Integer bridgeId) {
        fseBridgeService.del(bridgeId);
    }

    @Override
    public void bind(FseBridgeBindParam param) {
        fseBridgeService.bind(param);
    }

    @Override
    public void unbind(FseBridgeUnbindParam param) {
        fseBridgeService.unbind(param);
    }

    @Override
    public FseBridgeDataDTO monitor(Integer bridgeId) {
        return fseBridgeService.monitor(bridgeId);
    }

    @Override
    public FseBridgeDTO details(Integer bridgeId) {
        return fseBridgeService.details(bridgeId);
    }

    @Override
    public ListData<FseBridgeDataLogDTO> bridgeLog(Integer bridgeId, Date time) {
        List<FseBridgeDataLogDTO> list = fseBridgeService.bridgeLog(bridgeId, time);
        return new ListData<>(list);
    }
}
